import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("system_menu", { schema: "cabinet" })
export class SystemMenu {
  @PrimaryGeneratedColumn({ type: "smallint", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", comment: "菜单名字", length: 10 })
  name: string;

  @Column("varchar", { name: "path", comment: "路由", length: 30 })
  path: string;

  @Column("varchar", { name: "component", comment: "组件", length: 30 })
  component: string;

  @Column("tinyint", {
    name: "keep_alive",
    unsigned: true,
    default: () => "'0'",
  })
  keepAlive: number;

  @Column("tinyint", {
    name: "display",
    comment: "是否展示",
    unsigned: true,
    default: () => "'0'",
  })
  display: number;

  @Column("smallint", {
    name: "sort",
    comment: "排序",
    unsigned: true,
    default: () => "'0'",
  })
  sort: number;

  @Column("smallint", {
    name: "parent_id",
    comment: "上级",
    unsigned: true,
    default: () => "'0'",
  })
  parentId: number;
}
